package com.infoland.afanmall.model.order.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.AppCompatTextView;
import android.view.View;

import com.infoland.afanmall.R;
import com.infoland.afanmall.model.order.dialog.PayDialogBy;
import com.infoland.afanmall.base.util.ToolsKit;
import com.infoland.afanmall.model.order.entity.OrderByResponse;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


public class PayErroeActivity extends AppCompatActivity {

    @BindView(R.id.by_error_back)
    AppCompatTextView byErrorBack;
    @BindView(R.id.by_error_restart)
    AppCompatTextView byErrorRestart;
    public static OrderDownActivity downCartActivity;
    public static PayDialogBy payDialogBy;
    public static String type;
    public static String error_type;
    public static OrderByResponse.ObjectBean object;


    public static void setPara(OrderByResponse.ObjectBean object, String type, OrderDownActivity downCartActivity, String error_type, PayDialogBy payDialogBy) {
        PayErroeActivity.downCartActivity = downCartActivity;
        PayErroeActivity.type = type;
        PayErroeActivity.error_type = error_type;
        PayErroeActivity.payDialogBy = payDialogBy;

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.pay_error_activity);
        ButterKnife.bind(this);
        initData();
    }

    private void initData() {
    }

    @OnClick({R.id.by_error_back, R.id.by_error_restart})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.by_error_back:
//                if (orderDownActivity != null) {
//                    orderDownActivity.finish();
//                }
//                if (downCartActivity != null) {
//                    downCartActivity.finish();
//                }
                ToolsKit.go(PaySuccessActivity.class);
                finish();
                break;
            case R.id.by_error_restart:
                finish();
                break;
        }
    }

    @Override
    protected void onDestroy() {
        ToolsKit.deleteOKHttp(this);
        super.onDestroy();
    }

//


}
